/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Connection;

import Console.FileReadWriter;
import Security.EncryptorAES;
import dao.AccountDao;
import model.AccountManager;
import pojo.Account;

/**
 *
 * @author Kenneth Veenstra <kenneth.veenstra@gmail.com>
 */
public class Rebuild
{
    private FileReadWriter frw;

    public Rebuild()
    {
        frw = new FileReadWriter();
    }

    public void build()
    {
        frw = new FileReadWriter();
        DatabaseConnection dbc = new DatabaseConnection();
        for ( String s : frw.getSqlList() )
        {
            dbc.executeQuery(s);
        }
        AccountManager am = new AccountManager(new AccountDao());
        am.createAccount(new Account("Kenneth", "Veenstra", "Kenny", EncryptorAES.encrypt("Trollface"), 20, "Kenneth.veenstra@gmail.com"));
        am.createAccount(new Account("Test", "User", "Testuser", EncryptorAES.encrypt("Test"), 18, "Testuser@localhost.nl"));
    }

    public static void main(String[] args)
    {
        Rebuild rb = new Rebuild();
        rb.build();
    }
}
